//
//  E7Map.h
//  e7engine
//
//  Created by cc on 12-3-7.
//  Copyright (c) 2012年 PalmGame. All rights reserved.
//

#ifndef e7engine_E7Map_h
#define e7engine_E7Map_h

#include "E7GameDefine.h"

#include "E7Cell.h"

class CE7Map
{
public:
    CE7Map() ;
    ~CE7Map() ;

public:
    bool Create(int nID, const char* plistfile) ;
    bool Create(int nID, int mapid, int mapsize, int* pData) ;
    bool Create(int nID, const int createid) ;
    void Destroy() ;
    void Save(const char* filename) ;
    void SaveToUserDefault() ;
    void SetSaveMapData() ;

    CE7Cell*   GetSelectCellInfo(CCPoint pos) ;
    CE7Cell*   GetSelectCellInfo(int nID) ;

    int            GetID()           { return m_nID ; }
    bool           IsCreated()       { return m_bIsCreated ; }
    CE7Cell*       GetCellInfo()     { return m_pCreateCells ; }
    int            GetCellCount()    { return m_nAllCount ; }
    int            GetCountryCount() { return m_nCreateCountrys ; }
    bool           IsLoadMap()       { return m_bIsLoadFlag ; }
    int*           GetLoadData()     { return m_pLoadData ; }
    CCSize         GetMaxSize()      { return m_sMaxSize ; }

public:
    void RandomMap() ;
    void LoadMap() ;

public:
    CELL_INFO_LIST    m_listCells ;

private:
    int               m_nID ;
    bool              m_bIsCreated ;    // create map flag.
    int               m_nCreateMapID ;  // create map id.

    CE7Cell*          m_pCreateCells ;
    int*              m_pSaveData ;
    int               m_nCreateCountrys ;
    int               m_nCreateCount ;
    int               m_nAllCount ;

    bool              m_bIsLoadFlag ;
    int*              m_pLoadData ;

    CCSize            m_sMaxSize ;
};

#endif

















